{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-10-10T03:03:00.861925Z",
     "start_time": "2019-10-10T03:03:00.090986Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>CREDIT_BY</th>\n",
       "      <th>用户类型</th>\n",
       "      <th>省份</th>\n",
       "      <th>地市</th>\n",
       "      <th>贷款金额</th>\n",
       "      <th>完成时间</th>\n",
       "      <th>账期</th>\n",
       "      <th>月底逾期期数</th>\n",
       "      <th>mob</th>\n",
       "      <th>月底剩余本金</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>淮安市</td>\n",
       "      <td>780.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>780.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>HUABEI</td>\n",
       "      <td>6</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>959.40</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>959.400000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>淮安市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>MASHANGXIAOJIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>1560.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1560.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>HUABEI</td>\n",
       "      <td>6</td>\n",
       "      <td>广东省</td>\n",
       "      <td>惠州市</td>\n",
       "      <td>2399.73</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2399.730000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>中山市</td>\n",
       "      <td>780.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>780.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>780.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>780.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>1170.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1170.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>995.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>995.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>中山市</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>975.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>HUABEI</td>\n",
       "      <td>6</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>959.40</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>959.400000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>HUABEI</td>\n",
       "      <td>6</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>2399.73</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2399.730000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>1131.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1131.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>广东省</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>975.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>淮安市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>中山市</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>975.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>1365.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1365.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>淮安市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>HUABEI</td>\n",
       "      <td>6</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>959.40</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>959.400000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>HUABEI</td>\n",
       "      <td>6</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>2399.73</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2399.730000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>1365.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1365.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>780.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>780.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201904</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>390.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607383</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>812.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607384</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>淮安市</td>\n",
       "      <td>1170.00</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1023.750000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607385</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201906</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>893.750000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607386</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>淮安市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201906</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>357.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607387</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>惠州市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>341.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607388</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>淮安市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>341.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607389</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>812.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607390</th>\n",
       "      <td>HUABEI</td>\n",
       "      <td>6</td>\n",
       "      <td>广东省</td>\n",
       "      <td>惠州市</td>\n",
       "      <td>959.40</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>839.475000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607391</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>广东省</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>853.125000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607392</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>780.00</td>\n",
       "      <td>201906</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>715.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607393</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>1560.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1300.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607394</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>780.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>650.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607395</th>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>341.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607396</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>1951.00</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1707.125000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607397</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>1951.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1625.833333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607398</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201906</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>893.750000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607399</th>\n",
       "      <td>JINGDONG</td>\n",
       "      <td>7</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>1199.25</td>\n",
       "      <td>201906</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1099.312500</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607400</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>淮安市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201906</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>357.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607401</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>1365.00</td>\n",
       "      <td>201906</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1251.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607402</th>\n",
       "      <td>MASHANGXIAOJIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>325.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607403</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>853.125000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607404</th>\n",
       "      <td>HUABEI</td>\n",
       "      <td>6</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>1350.54</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1125.450000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607405</th>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>1951.00</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1707.125000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607406</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>812.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607407</th>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>780.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>650.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607408</th>\n",
       "      <td>ZIZHUSHOUXIN</td>\n",
       "      <td>1</td>\n",
       "      <td>广东省</td>\n",
       "      <td>东莞市</td>\n",
       "      <td>1365.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1137.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607409</th>\n",
       "      <td>MASHANGXIAOJIN</td>\n",
       "      <td>2</td>\n",
       "      <td>重庆市</td>\n",
       "      <td>重庆市辖区</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201905</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>853.125000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607410</th>\n",
       "      <td>ZHAOLIAN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>无锡市</td>\n",
       "      <td>390.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>325.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607411</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>江苏省</td>\n",
       "      <td>淮安市</td>\n",
       "      <td>780.00</td>\n",
       "      <td>201904</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>650.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>607412</th>\n",
       "      <td>WEIXIN</td>\n",
       "      <td>2</td>\n",
       "      <td>广东省</td>\n",
       "      <td>惠州市</td>\n",
       "      <td>975.00</td>\n",
       "      <td>201906</td>\n",
       "      <td>201908</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>893.750000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>607413 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             CREDIT_BY  用户类型   省份     地市     贷款金额    完成时间      账期  月底逾期期数  \\\n",
       "0         ZIZHUSHOUXIN     1  江苏省    无锡市   390.00  201904  201904       0   \n",
       "1         ZIZHUSHOUXIN     1  江苏省    淮安市   780.00  201904  201904       0   \n",
       "2               HUABEI     6  江苏省    无锡市   959.40  201904  201904       0   \n",
       "3               WEIXIN     2  江苏省    淮安市   390.00  201904  201904       0   \n",
       "4       MASHANGXIAOJIN     2  江苏省    无锡市  1560.00  201904  201904       0   \n",
       "5               HUABEI     6  广东省    惠州市  2399.73  201904  201904       0   \n",
       "6               WEIXIN     2  广东省    中山市   780.00  201904  201904       0   \n",
       "7         ZIZHUSHOUXIN     1  江苏省    无锡市   780.00  201904  201904       0   \n",
       "8         ZIZHUSHOUXIN     1  江苏省    无锡市  1170.00  201904  201904       0   \n",
       "9               WEIXIN     2  广东省    东莞市   995.00  201904  201904       0   \n",
       "10              WEIXIN     2  广东省    中山市   975.00  201904  201904       0   \n",
       "11            ZHAOLIAN     2  江苏省    无锡市   390.00  201904  201904       0   \n",
       "12        ZIZHUSHOUXIN     1  江苏省    无锡市   390.00  201904  201904       0   \n",
       "13              HUABEI     6  江苏省    无锡市   959.40  201904  201904       0   \n",
       "14            ZHAOLIAN     2  江苏省    无锡市   390.00  201904  201904       0   \n",
       "15              HUABEI     6  江苏省    无锡市  2399.73  201904  201904       0   \n",
       "16              WEIXIN     2  广东省    东莞市  1131.00  201904  201904       0   \n",
       "17        ZIZHUSHOUXIN     1  广东省    东莞市   975.00  201904  201904       0   \n",
       "18              WEIXIN     2  江苏省    淮安市   390.00  201904  201904       0   \n",
       "19            ZHAOLIAN     2  江苏省    无锡市   390.00  201904  201904       0   \n",
       "20              WEIXIN     2  广东省    中山市   975.00  201904  201904       0   \n",
       "21              WEIXIN     2  广东省    东莞市  1365.00  201904  201904       0   \n",
       "22              WEIXIN     2  江苏省    淮安市   390.00  201904  201904       0   \n",
       "23              HUABEI     6  江苏省    无锡市   959.40  201904  201904       0   \n",
       "24              HUABEI     6  重庆市  重庆市辖区  2399.73  201904  201904       0   \n",
       "25              WEIXIN     2  江苏省    无锡市   390.00  201904  201904       0   \n",
       "26              WEIXIN     2  广东省    东莞市  1365.00  201904  201904       0   \n",
       "27            ZHAOLIAN     2  江苏省    无锡市   390.00  201904  201904       0   \n",
       "28        ZIZHUSHOUXIN     1  江苏省    无锡市   780.00  201904  201904       0   \n",
       "29        ZIZHUSHOUXIN     1  江苏省    无锡市   390.00  201904  201904       0   \n",
       "...                ...   ...  ...    ...      ...     ...     ...     ...   \n",
       "607383          WEIXIN     2  重庆市  重庆市辖区   975.00  201904  201908       0   \n",
       "607384          WEIXIN     2  江苏省    淮安市  1170.00  201905  201908       0   \n",
       "607385          WEIXIN     2  重庆市  重庆市辖区   975.00  201906  201908       0   \n",
       "607386          WEIXIN     2  江苏省    淮安市   390.00  201906  201908       0   \n",
       "607387          WEIXIN     2  广东省    惠州市   390.00  201905  201908       0   \n",
       "607388          WEIXIN     2  江苏省    淮安市   390.00  201905  201908       0   \n",
       "607389    ZIZHUSHOUXIN     1  重庆市  重庆市辖区   975.00  201904  201908       0   \n",
       "607390          HUABEI     6  广东省    惠州市   959.40  201905  201908       0   \n",
       "607391    ZIZHUSHOUXIN     1  广东省    东莞市   975.00  201905  201908       0   \n",
       "607392          WEIXIN     2  江苏省    无锡市   780.00  201906  201908       0   \n",
       "607393    ZIZHUSHOUXIN     1  江苏省    无锡市  1560.00  201904  201908       0   \n",
       "607394    ZIZHUSHOUXIN     1  江苏省    无锡市   780.00  201904  201908       0   \n",
       "607395        ZHAOLIAN     2  江苏省    无锡市   390.00  201905  201908       0   \n",
       "607396          WEIXIN     2  重庆市  重庆市辖区  1951.00  201905  201908       0   \n",
       "607397          WEIXIN     2  重庆市  重庆市辖区  1951.00  201904  201908       0   \n",
       "607398          WEIXIN     2  重庆市  重庆市辖区   975.00  201906  201908       0   \n",
       "607399        JINGDONG     7  重庆市  重庆市辖区  1199.25  201906  201908       0   \n",
       "607400    ZIZHUSHOUXIN     1  江苏省    淮安市   390.00  201906  201908       0   \n",
       "607401          WEIXIN     2  广东省    东莞市  1365.00  201906  201908       0   \n",
       "607402  MASHANGXIAOJIN     2  江苏省    无锡市   390.00  201904  201908       0   \n",
       "607403          WEIXIN     2  广东省    东莞市   975.00  201905  201908       0   \n",
       "607404          HUABEI     6  江苏省    无锡市  1350.54  201904  201908       0   \n",
       "607405        ZHAOLIAN     2  江苏省    无锡市  1951.00  201905  201908       0   \n",
       "607406          WEIXIN     2  重庆市  重庆市辖区   975.00  201904  201908       0   \n",
       "607407        ZHAOLIAN     2  江苏省    无锡市   780.00  201904  201908       0   \n",
       "607408    ZIZHUSHOUXIN     1  广东省    东莞市  1365.00  201904  201908       0   \n",
       "607409  MASHANGXIAOJIN     2  重庆市  重庆市辖区   975.00  201905  201908       0   \n",
       "607410        ZHAOLIAN     2  江苏省    无锡市   390.00  201904  201908       0   \n",
       "607411          WEIXIN     2  江苏省    淮安市   780.00  201904  201908       0   \n",
       "607412          WEIXIN     2  广东省    惠州市   975.00  201906  201908       0   \n",
       "\n",
       "        mob       月底剩余本金  \n",
       "0         0   390.000000  \n",
       "1         0   780.000000  \n",
       "2         0   959.400000  \n",
       "3         0   390.000000  \n",
       "4         0  1560.000000  \n",
       "5         0  2399.730000  \n",
       "6         0   780.000000  \n",
       "7         0   780.000000  \n",
       "8         0  1170.000000  \n",
       "9         0   995.000000  \n",
       "10        0   975.000000  \n",
       "11        0   390.000000  \n",
       "12        0   390.000000  \n",
       "13        0   959.400000  \n",
       "14        0   390.000000  \n",
       "15        0  2399.730000  \n",
       "16        0  1131.000000  \n",
       "17        0   975.000000  \n",
       "18        0   390.000000  \n",
       "19        0   390.000000  \n",
       "20        0   975.000000  \n",
       "21        0  1365.000000  \n",
       "22        0   390.000000  \n",
       "23        0   959.400000  \n",
       "24        0  2399.730000  \n",
       "25        0   390.000000  \n",
       "26        0  1365.000000  \n",
       "27        0   390.000000  \n",
       "28        0   780.000000  \n",
       "29        0   390.000000  \n",
       "...     ...          ...  \n",
       "607383    4   812.500000  \n",
       "607384    3  1023.750000  \n",
       "607385    2   893.750000  \n",
       "607386    2   357.500000  \n",
       "607387    3   341.250000  \n",
       "607388    3   341.250000  \n",
       "607389    4   812.500000  \n",
       "607390    3   839.475000  \n",
       "607391    3   853.125000  \n",
       "607392    2   715.000000  \n",
       "607393    4  1300.000000  \n",
       "607394    4   650.000000  \n",
       "607395    3   341.250000  \n",
       "607396    3  1707.125000  \n",
       "607397    4  1625.833333  \n",
       "607398    2   893.750000  \n",
       "607399    2  1099.312500  \n",
       "607400    2   357.500000  \n",
       "607401    2  1251.250000  \n",
       "607402    4   325.000000  \n",
       "607403    3   853.125000  \n",
       "607404    4  1125.450000  \n",
       "607405    3  1707.125000  \n",
       "607406    4   812.500000  \n",
       "607407    4   650.000000  \n",
       "607408    4  1137.500000  \n",
       "607409    3   853.125000  \n",
       "607410    4   325.000000  \n",
       "607411    4   650.000000  \n",
       "607412    2   893.750000  \n",
       "\n",
       "[607413 rows x 10 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import os\n",
    "import pandas as pd\n",
    "os.chdir(r'D:\\groupby')\n",
    "dt=pd.read_csv('data.csv',encoding='gbk')\n",
    "dt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-10-10T03:03:04.970091Z",
     "start_time": "2019-10-10T03:03:04.963106Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['CREDIT_BY',\n",
       " '用户类型',\n",
       " '省份',\n",
       " '地市',\n",
       " '贷款金额',\n",
       " '完成时间',\n",
       " '账期',\n",
       " '月底逾期期数',\n",
       " 'mob',\n",
       " '月底剩余本金']"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(dt)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-10-10T03:03:13.088414Z",
     "start_time": "2019-10-10T03:03:12.724389Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>贷款金额</th>\n",
       "      <th>月底剩余本金</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>CREDIT_BY</th>\n",
       "      <th>用户类型</th>\n",
       "      <th>省份</th>\n",
       "      <th>地市</th>\n",
       "      <th>完成时间</th>\n",
       "      <th>账期</th>\n",
       "      <th>月底逾期期数</th>\n",
       "      <th>mob</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"30\" valign=\"top\">BESTPAY</th>\n",
       "      <th rowspan=\"30\" valign=\"top\">3</th>\n",
       "      <th rowspan=\"20\" valign=\"top\">广东省</th>\n",
       "      <th rowspan=\"8\" valign=\"top\">东莞市</th>\n",
       "      <th rowspan=\"8\" valign=\"top\">201904</th>\n",
       "      <th>201904</th>\n",
       "      <th>0</th>\n",
       "      <th>0</th>\n",
       "      <td>42903.0</td>\n",
       "      <td>4.290300e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201905</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <td>42903.0</td>\n",
       "      <td>4.111538e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">201906</th>\n",
       "      <th>0</th>\n",
       "      <th>2</th>\n",
       "      <td>41928.0</td>\n",
       "      <td>3.843400e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <td>975.0</td>\n",
       "      <td>9.343750e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">201907</th>\n",
       "      <th>0</th>\n",
       "      <th>3</th>\n",
       "      <td>41928.0</td>\n",
       "      <td>3.668700e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <td>975.0</td>\n",
       "      <td>9.343750e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">201908</th>\n",
       "      <th>0</th>\n",
       "      <th>4</th>\n",
       "      <td>41928.0</td>\n",
       "      <td>3.494000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <td>975.0</td>\n",
       "      <td>9.343750e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"7\" valign=\"top\">中山市</th>\n",
       "      <th rowspan=\"7\" valign=\"top\">201904</th>\n",
       "      <th>201904</th>\n",
       "      <th>0</th>\n",
       "      <th>0</th>\n",
       "      <td>24985.0</td>\n",
       "      <td>2.498500e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">201905</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <td>24010.0</td>\n",
       "      <td>2.300958e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>1</th>\n",
       "      <td>975.0</td>\n",
       "      <td>9.750000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">201906</th>\n",
       "      <th>0</th>\n",
       "      <th>2</th>\n",
       "      <td>24010.0</td>\n",
       "      <td>2.200917e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>2</th>\n",
       "      <td>975.0</td>\n",
       "      <td>9.750000e+02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201907</th>\n",
       "      <th>0</th>\n",
       "      <th>3</th>\n",
       "      <td>24985.0</td>\n",
       "      <td>2.186188e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201908</th>\n",
       "      <th>0</th>\n",
       "      <th>4</th>\n",
       "      <td>24985.0</td>\n",
       "      <td>2.082083e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">惠州市</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">201904</th>\n",
       "      <th>201904</th>\n",
       "      <th>0</th>\n",
       "      <th>0</th>\n",
       "      <td>3510.0</td>\n",
       "      <td>3.510000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201905</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <td>3510.0</td>\n",
       "      <td>3.363750e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201906</th>\n",
       "      <th>0</th>\n",
       "      <th>2</th>\n",
       "      <td>3510.0</td>\n",
       "      <td>3.217500e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201907</th>\n",
       "      <th>0</th>\n",
       "      <th>3</th>\n",
       "      <td>3510.0</td>\n",
       "      <td>3.071250e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201908</th>\n",
       "      <th>0</th>\n",
       "      <th>4</th>\n",
       "      <td>3510.0</td>\n",
       "      <td>2.925000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">江苏省</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">无锡市</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">201904</th>\n",
       "      <th>201904</th>\n",
       "      <th>0</th>\n",
       "      <th>0</th>\n",
       "      <td>10530.0</td>\n",
       "      <td>1.053000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201905</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <td>10530.0</td>\n",
       "      <td>1.009125e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201906</th>\n",
       "      <th>0</th>\n",
       "      <th>2</th>\n",
       "      <td>10530.0</td>\n",
       "      <td>9.652500e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201907</th>\n",
       "      <th>0</th>\n",
       "      <th>3</th>\n",
       "      <td>10530.0</td>\n",
       "      <td>9.213750e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201908</th>\n",
       "      <th>0</th>\n",
       "      <th>4</th>\n",
       "      <td>10530.0</td>\n",
       "      <td>8.775000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">淮安市</th>\n",
       "      <th rowspan=\"5\" valign=\"top\">201904</th>\n",
       "      <th>201904</th>\n",
       "      <th>0</th>\n",
       "      <th>0</th>\n",
       "      <td>27301.0</td>\n",
       "      <td>2.730100e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201905</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <td>27301.0</td>\n",
       "      <td>2.616346e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201906</th>\n",
       "      <th>0</th>\n",
       "      <th>2</th>\n",
       "      <td>27301.0</td>\n",
       "      <td>2.502592e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201907</th>\n",
       "      <th>0</th>\n",
       "      <th>3</th>\n",
       "      <td>27301.0</td>\n",
       "      <td>2.388838e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201908</th>\n",
       "      <th>0</th>\n",
       "      <th>4</th>\n",
       "      <td>26911.0</td>\n",
       "      <td>2.242583e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"30\" valign=\"top\">ZIZHUSHOUXIN</th>\n",
       "      <th rowspan=\"30\" valign=\"top\">1</th>\n",
       "      <th rowspan=\"30\" valign=\"top\">重庆市</th>\n",
       "      <th rowspan=\"30\" valign=\"top\">重庆市辖区</th>\n",
       "      <th rowspan=\"11\" valign=\"top\">201904</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">201906</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <td>9600.0</td>\n",
       "      <td>9.200000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>2</th>\n",
       "      <td>10250.0</td>\n",
       "      <td>1.025000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"4\" valign=\"top\">201907</th>\n",
       "      <th>0</th>\n",
       "      <th>3</th>\n",
       "      <td>892961.0</td>\n",
       "      <td>7.813409e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>3</th>\n",
       "      <td>1975.0</td>\n",
       "      <td>1.810417e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <td>5700.0</td>\n",
       "      <td>5.462500e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>3</th>\n",
       "      <td>9275.0</td>\n",
       "      <td>9.275000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">201908</th>\n",
       "      <th>0</th>\n",
       "      <th>4</th>\n",
       "      <td>892554.0</td>\n",
       "      <td>7.437950e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>4</th>\n",
       "      <td>7175.0</td>\n",
       "      <td>6.278125e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>4</th>\n",
       "      <td>1975.0</td>\n",
       "      <td>1.810417e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <td>1799.0</td>\n",
       "      <td>1.724042e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <th>4</th>\n",
       "      <td>6408.0</td>\n",
       "      <td>6.408000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">201905</th>\n",
       "      <th>201905</th>\n",
       "      <th>0</th>\n",
       "      <th>0</th>\n",
       "      <td>1841271.0</td>\n",
       "      <td>1.841271e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">201906</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <td>1803443.0</td>\n",
       "      <td>1.728300e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>1</th>\n",
       "      <td>37828.0</td>\n",
       "      <td>3.782800e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">201907</th>\n",
       "      <th>0</th>\n",
       "      <th>2</th>\n",
       "      <td>1787823.0</td>\n",
       "      <td>1.638838e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <td>26288.0</td>\n",
       "      <td>2.519267e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>2</th>\n",
       "      <td>27160.0</td>\n",
       "      <td>2.716000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"4\" valign=\"top\">201908</th>\n",
       "      <th>0</th>\n",
       "      <th>3</th>\n",
       "      <td>1795661.0</td>\n",
       "      <td>1.571203e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>3</th>\n",
       "      <td>6675.0</td>\n",
       "      <td>6.118750e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <td>17627.0</td>\n",
       "      <td>1.689254e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <th>3</th>\n",
       "      <td>21308.0</td>\n",
       "      <td>2.130800e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"6\" valign=\"top\">201906</th>\n",
       "      <th>201906</th>\n",
       "      <th>0</th>\n",
       "      <th>0</th>\n",
       "      <td>1599743.0</td>\n",
       "      <td>1.599743e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">201907</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <td>1573680.0</td>\n",
       "      <td>1.508110e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>1</th>\n",
       "      <td>26063.0</td>\n",
       "      <td>2.606300e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">201908</th>\n",
       "      <th>0</th>\n",
       "      <th>2</th>\n",
       "      <td>1559303.0</td>\n",
       "      <td>1.429361e+06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <td>23154.0</td>\n",
       "      <td>2.218925e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <th>2</th>\n",
       "      <td>17286.0</td>\n",
       "      <td>1.728600e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">201907</th>\n",
       "      <th>201907</th>\n",
       "      <th>0</th>\n",
       "      <th>0</th>\n",
       "      <td>468820.0</td>\n",
       "      <td>4.688200e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">201908</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <td>451940.0</td>\n",
       "      <td>4.331092e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <th>1</th>\n",
       "      <td>16880.0</td>\n",
       "      <td>1.688000e+04</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1120 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                           贷款金额        月底剩余本金\n",
       "CREDIT_BY    用户类型 省份  地市    完成时间   账期     月底逾期期数 mob                         \n",
       "BESTPAY      3    广东省 东莞市   201904 201904 0      0      42903.0  4.290300e+04\n",
       "                                   201905 0      1      42903.0  4.111538e+04\n",
       "                                   201906 0      2      41928.0  3.843400e+04\n",
       "                                          1      2        975.0  9.343750e+02\n",
       "                                   201907 0      3      41928.0  3.668700e+04\n",
       "                                          2      3        975.0  9.343750e+02\n",
       "                                   201908 0      4      41928.0  3.494000e+04\n",
       "                                          3      4        975.0  9.343750e+02\n",
       "                      中山市   201904 201904 0      0      24985.0  2.498500e+04\n",
       "                                   201905 0      1      24010.0  2.300958e+04\n",
       "                                          1      1        975.0  9.750000e+02\n",
       "                                   201906 0      2      24010.0  2.200917e+04\n",
       "                                          2      2        975.0  9.750000e+02\n",
       "                                   201907 0      3      24985.0  2.186188e+04\n",
       "                                   201908 0      4      24985.0  2.082083e+04\n",
       "                      惠州市   201904 201904 0      0       3510.0  3.510000e+03\n",
       "                                   201905 0      1       3510.0  3.363750e+03\n",
       "                                   201906 0      2       3510.0  3.217500e+03\n",
       "                                   201907 0      3       3510.0  3.071250e+03\n",
       "                                   201908 0      4       3510.0  2.925000e+03\n",
       "                  江苏省 无锡市   201904 201904 0      0      10530.0  1.053000e+04\n",
       "                                   201905 0      1      10530.0  1.009125e+04\n",
       "                                   201906 0      2      10530.0  9.652500e+03\n",
       "                                   201907 0      3      10530.0  9.213750e+03\n",
       "                                   201908 0      4      10530.0  8.775000e+03\n",
       "                      淮安市   201904 201904 0      0      27301.0  2.730100e+04\n",
       "                                   201905 0      1      27301.0  2.616346e+04\n",
       "                                   201906 0      2      27301.0  2.502592e+04\n",
       "                                   201907 0      3      27301.0  2.388838e+04\n",
       "                                   201908 0      4      26911.0  2.242583e+04\n",
       "...                                                         ...           ...\n",
       "ZIZHUSHOUXIN 1    重庆市 重庆市辖区 201904 201906 1      2       9600.0  9.200000e+03\n",
       "                                          2      2      10250.0  1.025000e+04\n",
       "                                   201907 0      3     892961.0  7.813409e+05\n",
       "                                          1      3       1975.0  1.810417e+03\n",
       "                                          2      3       5700.0  5.462500e+03\n",
       "                                          3      3       9275.0  9.275000e+03\n",
       "                                   201908 0      4     892554.0  7.437950e+05\n",
       "                                          1      4       7175.0  6.278125e+03\n",
       "                                          2      4       1975.0  1.810417e+03\n",
       "                                          3      4       1799.0  1.724042e+03\n",
       "                                          4      4       6408.0  6.408000e+03\n",
       "                            201905 201905 0      0    1841271.0  1.841271e+06\n",
       "                                   201906 0      1    1803443.0  1.728300e+06\n",
       "                                          1      1      37828.0  3.782800e+04\n",
       "                                   201907 0      2    1787823.0  1.638838e+06\n",
       "                                          1      2      26288.0  2.519267e+04\n",
       "                                          2      2      27160.0  2.716000e+04\n",
       "                                   201908 0      3    1795661.0  1.571203e+06\n",
       "                                          1      3       6675.0  6.118750e+03\n",
       "                                          2      3      17627.0  1.689254e+04\n",
       "                                          3      3      21308.0  2.130800e+04\n",
       "                            201906 201906 0      0    1599743.0  1.599743e+06\n",
       "                                   201907 0      1    1573680.0  1.508110e+06\n",
       "                                          1      1      26063.0  2.606300e+04\n",
       "                                   201908 0      2    1559303.0  1.429361e+06\n",
       "                                          1      2      23154.0  2.218925e+04\n",
       "                                          2      2      17286.0  1.728600e+04\n",
       "                            201907 201907 0      0     468820.0  4.688200e+05\n",
       "                                   201908 0      1     451940.0  4.331092e+05\n",
       "                                          1      1      16880.0  1.688000e+04\n",
       "\n",
       "[1120 rows x 2 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt=dt.groupby(['CREDIT_BY','用户类型','省份','地市','完成时间','账期','月底逾期期数','mob']).sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-10-10T03:04:59.702651Z",
     "start_time": "2019-10-10T03:04:59.657771Z"
    }
   },
   "outputs": [],
   "source": [
    "dt.to_csv('op.csv',encoding='gbk')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2019-10-11T06:39:51.285634Z",
     "start_time": "2019-10-11T06:39:51.277656Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[4, 5, 6, 7]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(range(4,8))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
